package com.aaa.controller;

import com.aaa.entity.City;
import com.aaa.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("city")
public class CityController {
    @Autowired
    CityService ps;

    @RequestMapping("findCity")
    public List<City> findCity(int pid,String cityName){
        System.out.println("pid="+pid+"; cityName="+cityName);
        return ps.findCity(pid,cityName);
    }
}
